<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Dataset-JSON v1.1 Hands-On Implementation Training: macros/write_datasetjson.sas File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Dataset-JSON v1.1 Hands-On Implementation Training
   </div>
   <div id="projectbrief">Dataset-JSON v1.1 Hands-On Implementation Training</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','Search',true);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('df/d00/write__datasetjson_8sas.html','../../'); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">write_datasetjson.sas File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Write a SAS dataset to a Dataset-JSON file.  
<a href="#details">More...</a></p>

<p><a href="../../df/d00/write__datasetjson_8sas_source.html">Go to the source code of this file.</a></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Write a SAS dataset to a Dataset-JSON file. </p>
<p>This macro creates a Dataset-JSON file from a SAS dataset<br  />
 Metadata is taken from the dataset or from a number of metadata tables: </p><ul>
<li>metadata_study </li>
<li>metadata_tables </li>
<li>metadata_columns</li>
</ul>
<p>Some metadata can be specified as parameters (fileOID, originator, sourceSystem, sourceSystemVersion, studyOID, metaDataVersionOID, metaDataRef, datasetlabel).</p>
<p>Example usage: </p><pre class="fragment">%write_datasetjson(
    dataset=datasdtm.dm,
    jsonpath=&amp;project_folder/json_out/sdtm/dm.json);

%write_datasetjson(
    dataset=datasdtm.dm,
    jsonpath=&amp;project_folder/json_out/sdtm/dm.json,
    usemetadata=Y,
    metadatalib=metasdtm);
</pre><dl class="section author"><dt>Author</dt><dd>Lex Jansen</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">dataset=</td><td>(libname.)memname of the SAS data set </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">jsonpath=</td><td>Path to Dataset-JSON file </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">jsonfref=</td><td>File reference for the Dataset-JSON file. Either jsonpath or jsonfref has to be sppecified. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">usemetadata=</td><td>(N) Use Define-XML metadata? (Y/N) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">metadatalib=</td><td>Define-XML metadata library The following datasets are expected: <ul>
<li>metadata_study </li>
<li>metadata_tables </li>
<li>metadata_columns </li>
</ul>
</td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">decimalVariables=</td><td>List of numeric variables to write as decimal strings. Not used when usemetadata=Y. Separated by blanks. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">datasetJSONVersion=</td><td>(1.1.0) Dataset-JSON version. Allowed values: 1.1.* </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">originator=</td><td>The organization that generated the Dataset-JSON dataset. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sourceSystem=</td><td>The name of the information system from which the content of this dataset was sourced </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sourceSystemVersion=</td><td>The version of the information system from which the content of this dataset was sourced </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">studyOID=</td><td>Unique identifier for the study that may also function as a foreign key to a Study/@OID in an associated Define-XML file </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">metaDataVersionOID=</td><td>Unique identifier for the metadata version that may also function as a foreign key to a MetaDataVersion/@OID in an associated Define-XML file </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">metaDataRef=</td><td>URI for a metadata file describing the dataset (e.g., a Define-XML file) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">datasetlabel=</td><td>Dataset label </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">pretty=</td><td>(NOPRETTY) Format Dataset-JSON file (PRETTY/NOPRETTY).</td></tr>
  </table>
  </dd>
</dl>
<h4>Related Macros </h4>
<ul>
<li>write_datasetjson_1_0.sas </li>
<li><a class="el" href="../../da/d00/write__datasetjson__1__1_8sas_source.html">write_datasetjson_1_1.sas</a> </li>
</ul>

<p class="definition">Definition in file <a class="el" href="../../df/d00/write__datasetjson_8sas_source.html">write_datasetjson.sas</a>.</p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_c8843521cc2b354892efaf471a0b361e.html">macros</a></li><li class="navelem"><a class="el" href="../../df/d00/write__datasetjson_8sas.html">write_datasetjson.sas</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
  </ul>
</div>
</body>
</html>
